#!user/bin/env python3
# -- coding: utf-8 --
# @Createtime：2022/5/15 23:49
# @Updatetime：
# @Author：Test008
# @File：TotalStuInfo.py
# @Description：统计学生总人数模块
import os
from config import filename
from SearchStuInfo import show_student


def total():
    if os.path.exists(filename):
        with open(filename, 'r', encoding='utf-8') as rfile:
            info_list = rfile.readlines()
            if info_list:
                # show_student(info_list)
                print(f'一共有{len(info_list)}名学生。')
            else:
                print('还未录入学生信息')
    else:
        print('暂未保存学生信息...')
if __name__ == '__main__':
    total()